<template>
  <div class="quote-card">
    <div class="quote-icon">💭</div>
    <div class="quote-content">
      <p class="quote-text">{{ currentQuote.text }}</p>
      <p class="quote-author">— {{ currentQuote.author }}</p>
    </div>
    <button class="refresh-btn" @click="getRandomQuote">
      <span>🔄</span>
    </button>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'

const quotes = [
  { text: "考研不是终点，而是新生活的起点。", author: "考研人" },
  { text: "每一个不曾起舞的日子，都是对生命的辜负。", author: "尼采" },
  { text: "成功不是将来才有的，而是从决定去做的那一刻起，持续累积而成。", author: "佚名" },
  { text: "考研路上，坚持比努力更重要。", author: "考研成功者" },
  { text: "今天的努力，是为了明天的不后悔。", author: "考研导师" },
  { text: "书山有路勤为径，学海无涯苦作舟。", author: "韩愈" },
  { text: "不积跬步，无以至千里；不积小流，无以成江海。", author: "荀子" },
  { text: "考研是一场马拉松，不是短跑。", author: "考研专家" },
  { text: "相信自己，你能做到的比你想象的更多。", author: "励志语录" },
  { text: "知识改变命运，考研成就未来。", author: "教育名言" }
]

const currentQuote = ref(quotes[0])

const getRandomQuote = () => {
  const randomIndex = Math.floor(Math.random() * quotes.length)
  currentQuote.value = quotes[randomIndex]
}

onMounted(() => {
  getRandomQuote()
})
</script>

<style scoped>
.quote-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 30px;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
}

.quote-icon {
  font-size: 40px;
  opacity: 0.7;
  flex-shrink: 0;
}

.quote-content {
  flex: 1;
}

.quote-text {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 10px 0;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
}

.quote-author {
  font-size: 14px;
  color: #64ffda;
  margin: 0;
  text-align: right;
}

.refresh-btn {
  background: rgba(100, 255, 218, 0.1);
  border: 1px solid rgba(100, 255, 218, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.refresh-btn:hover {
  background: rgba(100, 255, 218, 0.2);
  transform: rotate(180deg);
}

.refresh-btn span {
  font-size: 20px;
  transition: transform 0.3s ease;
}
</style>